package main

import (
	"encoding/base64"
	"fmt"
)

//应用：web把图片加密，直接同网页一起传送，秘钥签名后，也要使用它来加密，把那些不直观看不见的数据装换看得见的字符串

var url string = "http://10.11.123.122:8080/agent/register?extra=KGRwMApTJ2Fzc2V0X2lkJwpwMQpTJ2JiNzUzN2M0YjBlM2VlNzg4MmRkYzQ2MTMzYWEyOTkxJwpwMgpzUydhZ2VudF9zdGF0dXMnCnAzClMnSURMRScKcDQKc1Mnb3NfbmFtZScKcDUKVm1pY3Jvc29mdF93aW5kb3dzX3NlcnZlcl8yMDA4CnA2CnNTJ2Fzc2V0X2lmYWNlJwpwNwoobHA4ClMnMTAuMTEuMTE1LjU4JwpwOQphc1Mnb3NfdmVyc2lvbicKcDEwClMnNi4wLjYwMDEnCnAxMQpzUydvc190eXBlJwpwMTIKUydXaW5kb3dzJwpwMTMKc1MnX2lkJwpwMTQKZzIKc1MnaXBfYWRkcmVzcycKcDE1ClMnMTAuMTEuMTE1LjU4JwpwMTYKc1MnYWdlbnRfdmVyc2lvbicKcDE3ClMnMTAwODcnCnAxOApzLg=="

/***/
func url_parser(url string)string{

	return ""
}

const (base64Table = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")

var coder = base64.NewEncoding(base64Table)

func decode_base64(src[]byte)([]byte,error){
	return coder.DecodeString(string(src))
}

func encode_base64(src []byte)[]byte{
	return []byte(coder.EncodeToString(src))
}

func main() {
	st := encode_base64([]byte("使用GoLang对中文进行编码？？？"))
	fmt.Println(st)
	fmt.Println(string(st))

	stde,_:=decode_base64(st)
	fmt.Println(stde)
	fmt.Println(string(stde))

	var codes []byte = []byte("KGRwMApTJ2Fzc2V0X2lkJwpwMQpTJ2JiNzUzN2M0YjBlM2VlNzg4MmRkYzQ2MTMzYWEyOTkxJwpwMgpzUydhZ2VudF9zdGF0dXMnCnAzClMnSURMRScKcDQKc1Mnb3NfbmFtZScKcDUKVm1pY3Jvc29mdF93aW5kb3dzX3NlcnZlcl8yMDA4CnA2CnNTJ2Fzc2V0X2lmYWNlJwpwNwoobHA4ClMnMTAuMTEuMTE1LjU4JwpwOQphc1Mnb3NfdmVyc2lvbicKcDEwClMnNi4wLjYwMDEnCnAxMQpzUydvc190eXBlJwpwMTIKUydXaW5kb3dzJwpwMTMKc1MnX2lkJwpwMTQKZzIKc1MnaXBfYWRkcmVzcycKcDE1ClMnMTAuMTEuMTE1LjU4JwpwMTYKc1MnYWdlbnRfdmVyc2lvbicKcDE3ClMnMTAwODcnCnAxOApzLg")
	stde2,_ := decode_base64(codes)
	fmt.Println(string(stde2))


}
